/*
 * @Author: RAY_HUI 1541917867@qq.com
 * @Date: 2025-07-11 14:14:30
 * @LastEditors: RAY_HUI 1541917867@qq.com
 * @LastEditTime: 2025-07-11 14:46:15
 * @FilePath: \elegant-admin-main\src\views\messages_demo\http\manage_messages.ts
 * @Description:
 *
 * Copyright (c) 2025 by ${git_name_email}, All Rights Reserved.
 */
import type { ReqMessageListParams, ResMessageList } from '../interface/manage_messages'
import type { ResPage, ResultData } from '@/api/interface'
import { PORT1 } from '@/api/config/servicePort'

import http from '@/api'

/** ******** 用户管理模块 */
// * 获取用户列表
export function getMessageListApi(params: ReqMessageListParams) {
  return http.post<ResPage<ResMessageList>>(`${PORT1}/admin/Message/page`, params)
}

// * 新增用户
export function addMessageApi(params: ReqMessageListParams) {
  return http.post<ResultData>(`${PORT1}/admin/Message/save`, params)
}

// * 编辑用户
export function editMessageApi(params: ReqMessageListParams) {
  return http.put<ResultData>(`${PORT1}/admin/Message/update`, params)
}
// * 用户详情
export function getMessageDetailApi(params: any) {
  return http.get<ResultData>(`${PORT1}/admin/Message/${params.id}`, params)
}
// * 删除用户
export function delMessageApi(params: { id: string }) {
  return http.delete<ResultData>(`${PORT1}/admin/Message/delete`, params)
}
